import {createMemoryHistory, createRouter, createWebHashHistory} from 'vue-router';

//制定路由规则
import Main from "../views/Main.vue";
import Home from "../views/Home.vue";
import User from "../views/User.vue";
import Mail from "../views/Mail.vue";
import Login from "../views/Login.vue";
import miss from "../views/404.vue";
const routes = [
    {
        path: '/',
        name: 'main',
        component: Main,
        redirect: '/home',
        children:[
            // {
            //     path: 'home',
            //     name: 'home',
            //     component: Home
            // },
            // //添加用户管理
            // {
            //     path: 'user',
            //     name: 'user',
            //     component: User
            // },
            // {
            //     path: 'mail',
            //     name: 'mail',
            //     component: Mail
            // },
        ],
    },
    {
        path: '/login',
        name: 'login',
        component: Login
    },
    {
        path: '/404',
        name: '404',
        component: miss
    }
]

const router=createRouter(
    {
        history:createWebHashHistory(),
        routes,
    }
);

//
export default router;